#include <stdio.h>
int main(int argc, const char *argv[])
{
	//读取文件行数
	FILE *p=fopen(argv[1],"r");
	if(p==NULL){
		printf("打开失败\n");
		return -1;
	}
	int n=0;
	unsigned char a=0;
	while(a!=EOF)//等价于a!=255
	{
		if(a==10) n++;
		a=fgetc(p);
	}
	printf("行数为%d\n%d\n",n,a);
	return 0;
}
